<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="/css/pintuer.css">
    <link rel="stylesheet" href="/css/admin.css">
    <script src="/js/jquery.js"></script>
    <script src="/js/pintuer.js"></script>
    <script src="/js/vuejs-2.5.16.js"></script>
    <script src="/js/axios-0.18.0.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="/element-ui/lib/index.js"></script>


</head>
<body>
<div class="panel admin-panel" id="moviesListDiv">
    <table class="table table-hover text-center">
        <tr>
            <th width="5%">序号</th>
            <th width="5%">ID</th>
            <th>昵称</th>
            <th width="10%">性别</th>
            <th>城市</th>
            <th>帐号状态</th>
            <th>用户详情</th>
			
        </tr>
        <tr v-for="(userInfoVo,index) in pagination.items">
            <td>{{userInfoVo.id}}</td>
            <td>{{userInfoVo.id}}</td>
            <td>{{userInfoVo.nickname}}</td>
            <td>{{userInfoVo.gender}}</td>
            <td>{{userInfoVo.city}}</td>
            <td>{{userInfoVo.userStatus}}</td>
            <td><a :href="'map.html?id='+userInfoVo.id">查看</a></td>
<!--            <td><a href="'map.html?id'=userInfoVo.id">查看</a> </td>-->

        </tr>
        <span>总记录数：{{pagination.counts}}</span>
        <tr>
            <td>
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="pagination.pageNum"
                            :page-size="pagination.pageSize"
                            background
                            layout="prev, pager, next"
                            :total="pagination.counts">
                    </el-pagination>
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    const app = new Vue({
        el: '#moviesListDiv',
        data: {
            cid: "",
            keyword: "",
            movieList: [],
            ids: [],
            pagination: {}
        },
        methods: {
            findByPage() {
                axios.get("/management/administrator", {
                    params: {
                        "pageNum": this.pagination.pageNum,
                        "pageSize": this.pagination.pageSize
                    }
                }).then(resp => {
                    this.pagination = resp.data;
					   console.log(this.pagination.items)
                })
            }
            ,
            //当前页改变时调用的方法
            handleCurrentChange(pageNum) {
                //将最新页码赋值给分页对象的当前页码
                this.pagination.pageNum = pageNum;
                //重新发起分页请求
                this.findByPage();
            },
            //改变每页大小时调用的方法
            handleSizeChange(pageSize) {
                //将最新的每页大爱小赋值给分页对象的当前页码
                this.pagination.pageSize = pageSize;
                //重新发起分页请求
                this.findByPage();
            },

        },
        created() {
            this.findByPage();
        }
    })
</script>
<script src="/js/verify.js"></script>
</body>
</html>